package com.sunshine.health.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 健康控制器
 * @author WeiHong
 * @date 2018/11/12
 */
@RestController
public class HealthController {

    /**
     * 标识当前数据库是否可以访问
     */
    public static Boolean CANVISIT_DB = false;

    @GetMapping("/db/{canVisitDb}")
    public String setConnectState(@PathVariable("canVisitDb") Boolean canVisitDb){
        CANVISIT_DB = canVisitDb;
        return "当前数据库是否正常: " + CANVISIT_DB;
    }
}
